﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Server
{
   public class CDateTime
    {
       public static DateTime DateTimeParse (string strdate)
       {
           string[] arr = strdate.Split(new char[]{'/', ' '}, StringSplitOptions.RemoveEmptyEntries);

           string str = arr[0] + "/" + arr[1] + "/" + arr[2];

           DateTime date = new DateTime();
           if(!DateTime.TryParse(str, out date))
           {
               str = arr[1] + "/" + arr[0] + "/" + arr[2];
               DateTime.TryParse(str, out date);
           }
           return date;
       }
    }
}
